{block name=body}
<div class="row form">
  <div class="col-sm-6">
    <div class="row terms-target">
      <div class="dashboard-title"><h3 class="title">Current term's target</h3></div>
      <div class="circle"><div class="top">{$target}</div>
      <div class="circledivider"></div>
      <div class="bottom"><span class="enrolments">{$enrolled} enrolled</span><br><span class="percentage">{$percenttarget}%</span></div>
      </div>
    </div>
    <div class="row">
      <div class="dashboard-title"><h3 class="title">报名付款状态</h3></div>
      <!-- This template loads a graph from google graphs -->
      <div class="graph"><div id="payment_chart_div"></div></div>
    </div>
    
  </div>
	<div class="col-sm-6">
		<div class="dashboard-title"><h3 class="title gd">基础信息</h3></div>
		<table class="table table-striped lblue">
			<!-- This data is loaded directly into the template -->
			<thead><tr><th>KPI</th><th>Current Term</th><th>上学期</th></tr></thead>
			<tbody>{foreach $generaldata as $dr}
				<tr>
					<td>{$dr.label}</td>
					<td>{$dr.value}</td>
					<td>{$dr.value2}</td>
				</tr>{/foreach}
			</tbody>
		</table>
	</div>
</div>
<div class="row form">
	<div class="col-sm-12">
		<div class="dashboard-title"><h3 class="title">教学地点学员数量</h3></div>
		<!-- This template loads a graph from google graphs -->
		<div class="graph"><div id="location_term_chart_div"></div></div>
	</div>
</div>

<!--Load the AJAX API-->
    <script type="text/javascript" src="http://ajax.useso.com/jsapi"></script>
<script type="text/javascript">
//Load the Visualization API and the piechart package.
google.load('visualization', '1.0', { 'packages':['corechart'] });

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawPaymentChart);
function drawPaymentChart() {
 
  // Create the data table.
  {if $enrolmentpiechartdata}
  var data = new google.visualization.DataTable();
  data.addColumn('string', 'Status');
  data.addColumn('number', 'Enrolments');
  data.addRows([{foreach from=$enrolmentpiechartdata key=myId item=val name=list}['{$val.label}', {$val.value}]{if not $smarty.foreach.list.last},{/if}{/foreach}
  ]);
  // Set chart options
  var options = { 'legend': { 'position': 'labeled' },
		  					 'pieSliceText':'value',
                 'width':500,
                 'height':300, 'pieStartAngle': 100, 
                 slices: { 
                	 {foreach from=$enrolmentpiechartdata key=myId item=val name=list}{$val.colourid}: { color: '{$val.colour}' }{if not $smarty.foreach.list.last},{/if}{/foreach}
                   }
  };

  // Instantiate and draw our chart, passing in some options.
  var chart = new google.visualization.PieChart(document.getElementById('payment_chart_div'));
  chart.draw(data, options); 
  {/if}
}

    //Set a callback to run when the Google Visualization API is loaded.
    google.setOnLoadCallback(drawLocationChart);
    function drawLocationChart() {
     
      // Create the data table.
      {if $enrolmentpiechartdata}
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Term');
      {foreach from=$enrolmentstatetermchartdata[$enrolmentstatetermfirstkey] key=myId item=val name=list}
      data.addColumn('number', '{$val.location_name}');
      {/foreach}
      data.addRows([
                    {foreach from=$enrolmentstatetermchartdata key=myId item=val name=list}
                    ['{$myId}',{foreach from=$val key=myId2 item=val2 name=list2}{$val2.enrolment}{if not $smarty.foreach.list2.last},{/if}{/foreach} ]{if not $smarty.foreach.list.last},{/if}
                    {/foreach}
      ]);
      
      // Set chart options
      var options = { 
                      vAxis: { title: "Number of enrolments", titleTextStyle: { color: "black" } },
                      hAxis: { title: "Term", titleTextStyle: { color: "black" } },
                     'width':1000,
                     'height':300,
                     colors: ['#48ac29','#009bdb','#f55d0f','#ffae00','#0bd0cd','#d6165e','#008081','#3a6475','#9b53d2','#ffdf06'] };

      // Instantiate and draw our chart, passing in some options.
      var chart = new google.visualization.ColumnChart(document.getElementById('location_term_chart_div'));
      chart.draw(data, options); 
      {/if}
    }
</script>

{/block} 



